package com.ruoyi.zhjd.laboratory.modules.marshallStabilityNew.controller;

import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
// import com.qzsoft.jeemis.common.utils.Result;
// import com.qzsoft.zhjd.common.utils.ResultUtils;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.zhjd.laboratory.modules.marshallStabilityNew.entity.MarshallStabilityNewProcessResEntity;
import com.ruoyi.zhjd.laboratory.modules.marshallStabilityNew.service.MarshallStabilityNewProcessResService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 马歇尔稳定度测定仪_试验结果过程数据

 *
 * @author sx
 * @email
 * @date 2023-07-11 18:56:40
 */
@RestController
@RequestMapping("laboratory/marshallStabilityNewProcessRes")
public class MarshallStabilityNewProcessResController {

    @Autowired
    private MarshallStabilityNewProcessResService marshallStabilityNewProcessResService;

    /**
     * 列表
     */
    @RequestMapping("/page")
    //
    public R page(@RequestParam Map<String, Object> params){
        IPage page = marshallStabilityNewProcessResService.queryPage(params);
        return R.ok(page);
    }


    /**
     * 信息
     */
    @RequestMapping("/find/{id}")
    //
    public R find(@PathVariable("id") String id){
		MarshallStabilityNewProcessResEntity marshallStabilityNewProcessRes = marshallStabilityNewProcessResService.getInfo(id);
        return R.ok(marshallStabilityNewProcessRes);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //
    public R save(@RequestBody MarshallStabilityNewProcessResEntity marshallStabilityNewProcessRes){
		marshallStabilityNewProcessResService.saveData(marshallStabilityNewProcessRes);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //
    public R update(@RequestBody MarshallStabilityNewProcessResEntity marshallStabilityNewProcessRes){
        marshallStabilityNewProcessResService.updateData(marshallStabilityNewProcessRes);
        return R.ok();
    }


    /**
     * 删除单个
     */
    @RequestMapping("/delete/{id}")
    //
    public R deleteOne(@PathVariable("id") String id){
        marshallStabilityNewProcessResService.deleteOneData(id);
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //
    public R delete(@RequestBody String[] ids){
        marshallStabilityNewProcessResService.deleteData(Arrays.asList(ids));
        return R.ok();
    }
}
